package com.lw.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.Table;
import java.io.Serializable;
import java.time.LocalDateTime;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 操作日志 实体类。
 *
 * @author lw
 * @since 2025年04月30日 16:10:43
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(name = "操作日志")
@Table("tb_operation_log")
public class TbOperationLog implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @Id
    @Schema(description = "id")
    private Long id;

    /**
     * 用户操作
     */
    @Schema(description = "用户操作")
    private String operation;

    /**
     * 请求URI
     */
    @Schema(description = "请求URI")
    private String requestUri;

    /**
     * 请求方式
     */
    @Schema(description = "请求方式")
    private String requestMethod;

    /**
     * 请求参数
     */
    @Schema(description = "请求参数")
    private String requestParams;

    /**
     * 请求时长(毫秒)
     */
    @Schema(description = "请求时长(毫秒)")
    private Long requestTime;

    /**
     * 用户代理
     */
    @Schema(description = "用户代理")
    private String userAgent;

    /**
     * 操作IP
     */
    @Schema(description = "操作IP")
    private String ip;

    /**
     * 状态  0：失败   1：成功
     */
    @Schema(description = "状态  0：失败   1：成功")
    private Integer status;

    /**
     * 用户名
     */
    @Schema(description = "用户名")
    private String creatorName;

    /**
     * 创建者
     */
    @Schema(description = "创建者")
    private Long creator;

    /**
     * 创建时间
     */
    @Schema(description = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createDate;

    @Schema(description = "操作对象id")
    private String objId;

    @Schema(description = "返回结果")
    private String response;
}
